#include<iostream>
#include<memory>
#include"udp_server.hpp"

using namespace std;

void usage(string proc)
{
    cout << "Usage:\n\t" << proc << " local_port\n" << endl;
}
int main(int argc,char*argv[])
{
    if(argc!=2)
    {
        //参数不正确
        usage(argv[0]);
        exit(USAGE_ERROR);
    }
    EnableScreen();

    //端口号
    uint16_t port=stoi(argv[1]);
    // string ip=argv[1];
    std::unique_ptr<udpserver> usvr = std::make_unique<udpserver>(port); // C++14
    usvr->InitUdpserver();
    usvr->Start();


    return 0;
}